using System.Drawing;

namespace ICSharpCode.TextEditor.Document
{
	public class TextMarker : AbstractSegment
	{
		private TextMarkerType textMarkerType;

		private Color color;

		private Color foreColor;

		private string toolTip = null;

		private bool overrideForeColor = false;

		public TextMarkerType TextMarkerType => this.textMarkerType;

		public Color Color => this.color;

		public Color ForeColor => this.foreColor;

		public bool OverrideForeColor => this.overrideForeColor;

		public bool IsReadOnly { get; set; }

		public string ToolTip
		{
			get
			{
				return this.toolTip;
			}
			set
			{
				this.toolTip = value;
			}
		}

		public int EndOffset => this.Offset + this.Length - 1;

		public TextMarker(int offset, int length, TextMarkerType textMarkerType)
			: this(offset, length, textMarkerType, Color.Red)
		{
		}

		public TextMarker(int offset, int length, TextMarkerType textMarkerType, Color color)
		{
			if (length < 1)
			{
				length = 1;
			}
			base.offset = offset;
			base.length = length;
			this.textMarkerType = textMarkerType;
			this.color = color;
		}

		public TextMarker(int offset, int length, TextMarkerType textMarkerType, Color color, Color foreColor)
		{
			if (length < 1)
			{
				length = 1;
			}
			base.offset = offset;
			base.length = length;
			this.textMarkerType = textMarkerType;
			this.color = color;
			this.foreColor = foreColor;
			this.overrideForeColor = true;
		}
	}
}
